package com.example.devices.api

import com.example.base.app.conts.BaseConst
import com.example.common.view.api.BaseApiServer
import com.example.common.view.model.BaseResultData
import com.example.devices.entity.Devices
import com.example.devices.entity.OrderDetail
import com.example.devices.entity.OrderEntity
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.PATCH
import retrofit2.http.POST
import retrofit2.http.Path
import retrofit2.http.Query

interface DevicesApiServer:BaseApiServer {
    @GET(BaseConst.DEVICES_URL)
    suspend fun getDevices():BaseResultData<List<Devices>>
    @POST(BaseConst.DEVICES_URL)
    suspend fun postDevices(@Body body: RequestBody):BaseResultData<Devices>
    @GET(BaseConst.ORDER_URL)
    suspend fun getOrder():BaseResultData<List<OrderEntity>>
    @GET(BaseConst.ORDER_DETAIL_URL)
    suspend fun getOrderDetail(@Path("id")id:Int):BaseResultData<OrderDetail>
    @PATCH(BaseConst.INSPECTION_URL)
    suspend fun inspection(@Path("id")id:Int):BaseResultData<OrderDetail>
    @PATCH(BaseConst.TRANSFER_URL)
    suspend fun transfer(@Path("id")id:Int,@Query("inspector")inspector:String):BaseResultData<OrderDetail>
}